import request from '@/utils/request.js'

// 查询部门列表
export const inquireDepartment = () => {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

// 删除部门
export const delDepartments = (id) => {
//   console.log(id)
  return request({
    method: 'delete',
    url: '/company/department/' + id
  })
}

// 添加部门
export const addDepartments = (data) => {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

// 根据id查询部门详情
export const getDepartDetail = (id) => {
  return request({
    method: 'get',
    url: '/company/department/' + id
  })
}

// 根据id 修改部门
export const updateDepartments = (data) => {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}
